#include<stdio.h>
double n, m;
int main()
{
	scanf("%lf", &n);
	if(n < 5) m = n+5;
	else if(n < 10) m = n*3 - 1;
	else m = n*2 + 1;
	printf("%.2lf", m);
	return 0;
}
